<template>
        <div>
          <a-row gutter="16">
            <a-space>
              <a-button type="primary" @click="openMaterialModal">添加产品</a-button>
            </a-space>
          </a-row>
          <div style="margin-top: 16px;">
            <a-table bordered rowKey="id" size="middle" :columns="columns" :data-source="goodsData" :pagination="false">
              <div slot="chicun" slot-scope="value, item, index">
                <div v-if="item.isTotal">{{ value }}</div>                
                <a-input v-else v-model="item.chicun" :min="0" size="small" placeholder="" bordered={false} ></a-input>
              </div>
              <div slot="huchang" slot-scope="value, item, index">
                <div v-if="item.isTotal">{{ value }}</div>                
                <a-input v-else v-model="item.huchang" :min="0" size="small" placeholder="" bordered={false} ></a-input>
              </div>
              <div slot="clsl" slot-scope="value, item, index">
                <div v-if="item.isTotal">{{ value }}</div>
                <a-input-number v-else v-model="item.clsl" :min="0" size="small"></a-input-number>
              </div>
              <div slot="cldj" slot-scope="value, item, index">
                <div v-if="item.isTotal">{{ value }}</div>
                <a-input-number v-else v-model="item.cldj" :min="0" size="small"></a-input-number>
              </div>
              <div slot="clAmount" slot-scope="value, item, index">
                <div>{{ value?1:0 }}</div>                
              </div>
              <div slot="jgsl" slot-scope="value, item, index">
                <div v-if="item.isTotal">{{ value }}</div>
                <a-input-number v-else v-model="item.jgsl" :min="0" size="small"></a-input-number>
              </div>
              <div slot="jgdj" slot-scope="value, item, index">
                <div v-if="item.isTotal">{{ value }}</div>
                <a-input-number v-else v-model="item.jgdj" :min="0" size="small"></a-input-number>
              </div>
              <div slot="jgAmount" slot-scope="value, item, index">
                <div>{{ value }}</div>                
              </div>
              <div slot="totalAmount" slot-scope="value, item, index">
                <div>{{ value }}</div>
              </div>
              <div slot="beizhu" slot-scope="value, item, index">
                <div v-if="item.isTotal">{{ value }}</div>
                <a-input v-else v-model="item.beizhu" :min="0" size="small" placeholder="" bordered={false} ></a-input>
              </div>
              <div slot="action" slot-scope="value, item, index">
                <a-button-group v-if="!item.isTotal" size="small">
                  <a-button type="danger" @click="removeMaterial(item)">移除</a-button>
                </a-button-group>
              </div>
            </a-table>
          </div>
        </div>
</template>